package com.example.teesystem.entity.vo.knowledge;

import com.example.teesystem.common.valid.ValidErrorMessage;
import com.example.teesystem.common.valid.ValidId;
import com.example.teesystem.common.valid.ValidIds;
import lombok.Data;

import javax.validation.constraints.Min;
import java.util.List;

@Data
public class KnowledgeUpdateVo {
    /**
     * 主键（key）
     */
    @ValidId(message = ValidErrorMessage.KNOWLEDGE_ID_VALID_FAIL, ifKnowledgeId = true)
    private Integer id;

    /**
     * 课程id
     */
    @ValidId(message = ValidErrorMessage.COURSE_ID_VALID_FAIL, ifCourseId = true)
    private Integer courseId;

    /**
     * 章节id
     */
    @ValidId(message = ValidErrorMessage.CHAPTER_ID_VALID_FAIL)
    private Integer chapterId;

    /**
     * 类型（0：知识，1：能力，2：素质）
     */
    @Min(value = 0, message = ValidErrorMessage.KNOWLEDGE_TYPE_VALID_FAIL)
    private Integer type;

    /**
     * 具体信息
     */
    private String message;

    /**
     * 上一级知识点
     */
    @Min(value = 0, message = ValidErrorMessage.KNOWLEDGE_PARENT_ID_VALID_FAIL)
    private Integer parentId;

    /**
     * 关联知识点列表
     */
    @ValidIds(message = ValidErrorMessage.KNOWLEDGE_RELATION_VALID_FAIL)
    private List<Integer> relationKnowledge;
}